import Crypto from './Crypto';
const setItem = (key, value) => {
  const encryptValue = Crypto.encrypt(value);
  try {
    sessionStorage.setItem(key, encryptValue);
  } catch (error) {
    console.log(error);
  }
};
const getItem = (key) => {
  if (!key) return null;
  if (!sessionStorage.getItem(key)) return null;
  return Crypto.decrypt(sessionStorage.getItem(key));
};
export default {
  setItem,
  getItem,
};
